package main

import (
	"fmt"
	"net"

	pb "gitee.com/zfd81/dbrs/proto/dbrspb"
	"github.com/sirupsen/logrus"
	"google.golang.org/grpc"
)

func main() {
	//创建RPC服务
	lis, err := net.Listen("tcp", fmt.Sprintf(":%d", 9999))
	if err != nil {
		logrus.Fatalf("failed to listen: %v", err)
	}
	serv := grpc.NewServer()
	pb.RegisterBrokerServer(serv, &Broker{})
	err = serv.Serve(lis)
	if err != nil {
		logrus.Errorf("failed to api serve: %v", err)
	}
}
